
import matplotlib.pyplot as plt
import numpy as np

# 线的类型linestyle(简写ls), 'solid'/'-' -> 实线, 'dotted'/':' -> 点虚线, 'dashed'/'--' -> 破折线, 'dashdot'/'-.' -> 点划线
def fun1():
    ypoints = np.array([6, 2, 13, 10])

    plt.plot(ypoints, linestyle='dashdot')
    plt.show()

# 线的颜色color(简写c), r->红色, g->绿色, b->蓝色, c->青色, m->品红, y->黄色，k->黑色, w->白色
def fun2():
    ypoints = np.array([6, 2, 13, 10])

    plt.plot(ypoints, color='c')
    plt.show()

# 线的宽度linewidth(简写lw), 值可以是浮点数
def fun3():
    ypoints = np.array([6, 2, 13, 10])
    plt.plot(ypoints, linewidth='12.5')
    plt.show()

# 多条线
def fun4():
    y1 = np.array([3, 7, 5, 9])
    y2 = np.array([6, 2, 13, 10])

    plt.plot(y1)
    plt.plot(y2)
    plt.show()

# 多条线，自己设置x轴的值
def fun5():
    x1 = np.array([0, 1, 2, 3])
    y1 = np.array([3, 7, 5, 9])
    x2 = np.array([0, 1, 2, 3])
    y2 = np.array([6, 2, 13, 10])

    plt.plot(x1, y1, x2, y2)
    plt.show()

if __name__ == '__main__':
    fun5()